/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | foam-extend: Open Source CFD
   \\    /   O peration     | Version:     4.1
    \\  /    A nd           | Web:         http://www.foam-extend.org
     \\/     M anipulation  | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
	This file is part of foam-extend.

	foam-extend is free software: you can redistribute it and/or modify it
	under the terms of the GNU General Public License as published by the
	Free Software Foundation, either version 3 of the License, or (at your
	option) any later version.

	foam-extend is distributed in the hope that it will be useful, but
	WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
	General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.

Class
	pointPatchField

Description
	Abstract base class for point patch fields. Note the special
	mechanism at work here: the field itself holds no values, as the point
	values belong to the internal field. However, the field will create a
	list of values if required.

SourceFiles
	pointPatchField.C

\*---------------------------------------------------------------------------*/

#ifndef pointPatchField_H
#define pointPatchField_H

#include "PointPatchFieldTemplate.H"
#include "pointPatch.H"
#include "DummyMatrix.H"
#include "pointMesh.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{


template<class Type>
class pointPatchField
:
	public PointPatchField
	<
		pointPatchField,
		pointMesh,
		pointPatch,
		DummyMatrix,
		Type
	>
{

public:

	// Constructors

		//- Construct from patch and internal field
		pointPatchField
		(
			const pointPatch&,
			const DimensionedField<Type, pointMesh>&
		);

		//- Construct as copy
		pointPatchField(const pointPatchField<Type>&);

		//- Construct and return a clone
		virtual autoPtr<pointPatchField<Type> > clone() const
		{
			return autoPtr<pointPatchField<Type> >
			(
				new pointPatchField<Type>(*this)
			);
		}

		//- Construct as copy setting internal field reference
		pointPatchField
		(
			const pointPatchField<Type>&,
			const DimensionedField<Type, pointMesh>&
		);

		//- Construct and return a clone setting internal field reference
		virtual autoPtr<pointPatchField<Type> > clone
		(
			const DimensionedField<Type, pointMesh>& iF
		) const
		{
			return autoPtr<pointPatchField<Type> >
			(
				new pointPatchField<Type>(*this, iF)
			);
		}


	//- Destructor
	virtual ~pointPatchField()
	{}


	// Member operators

		virtual void operator=(const Type& t)
		{
			PointPatchField
			<
				Foam::pointPatchField,
				pointMesh,
				pointPatch,
				DummyMatrix,
				Type
			>::operator=(t);
		}
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#ifdef NoRepository
#	include "pointPatchField.C"
#endif


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //

